<?PHP $this->_extends('_layouts/manager_layout');?>
<?PHP $this->_block('head');?>

<?PHP $this->_endblock();?>
<?PHP $this->_block('contents');?>
<h2 class="aa1"> 邮件 </h2>
<table>
	<tr><th></th><th></th><th></th></tr>
	<?php foreach($mailtemplates as $s): 
			if($s['code']){unset($ms[$s['code']]);} ?>
		<tr>
			<th><?=$s['name']?></th>
			<th><?=$s['title']?> </th>
			<th> <a href="<?=url('/mailtemplateEdit',array('id'=>$s['id']))?>" style="margin-left:20px">Edit</a>  
			 <?php if($s['status']&1): ?> 
					<a href="<?=url('/mailtemplatestatusmodify',array('id'=>$s['id'],'status'=>'0'))?>" style="margin-left:20px" onclick="return confirm('确定停用吗')">Stop</a>
			<?php else: ?>
				<a href="<?=url('/mailtemplatestatusmodify',array('id'=>$s['id'],'status'=>'1'))?>" style="margin-left:20px" onclick="return confirm('确定启用吗')">Install</a>
				&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="<?=url('/mailtemplatestatusmodify',array('id'=>$s['id'],'cmd'=>'remove'))?>" style="margin-left:20px" onclick="return confirm('确定删除吗')">Remove</a>
			<?php endif; ?>  </th>
		</tr>
	<?php endforeach;?>
	<?php foreach($ms as $s):?>
		<tr>
			<th><?=$s['name']?></th>
			<th><?=$s['title']?></th>
			<th> <a href="<?=url('/mailtemplatestatusmodify',array('code'=>$s['code'],'status'=>'1'))?>" style="margin-left:20px" onclick="return confirm('确定启用吗')">Install</a>
			</th>
		</tr>
	<?php endforeach;?>
</table>
<div>
	<a href="<?=url('/mailtemplateedit')?>"> 添加 邮件 </a>
</div>

<?PHP $this->_endblock();?>

